﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UserManagement.aspx.cs" Inherits="CSM.Views.Management.UserManagement" theme="Default_1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>无标题页</title>
<script src="../../Js/jquery.js" type="text/javascript"></script>
<script src="../../Js/jquery.autocomplete.min.js" type="text/javascript"></script> 
<link href="../../App_Themes/Default_1/jquery.autocomplete.css" type="text/css" rel="stylesheet"/> 
<script type="text/javascript" src="../../Js/thickbox.js"></script>
<link rel="stylesheet" href="../../App_Themes/Default_1/thickbox.css" type="text/css" media="screen" />
<script language="javascript" type="text/javascript">
    //直接由数组获得 
    $(document).ready((function() {
        //由SERVER端获得
    $("#txtUser").autocomplete("GetData.ashx?database=TCsm_JS_User&which=UserName");
    }
));
    function ShowThickBox(b,a) {
        var div = a;
        var title = b;
        imgLoader = new Image(); // preload image
        imgLoader.src = tb_pathToImage;
        window.tb_show(title, "#TB_inline?height=300&width=400&inlineId=" + div, "");
    };
    function closewind() { window.tb_remove(); };
    function fade() { $("#divResult").hide(); }
    function ShowDetail(olinkButton) {
        var id = olinkButton.innerText;;
        var url = "GetUserRight.ashx?id=" + escape(id);
        var x = window.event.clientX + document.documentElement.scrollLeft;
        var y = window.event.clientY + document.documentElement.scrollTop;
        
        var fnCallBack = function(oResult) {
            var arr = new Array();
            arr = oResult.split('/');
            var oDivResult = document.getElementById("divResult");
            oDivResult.innerHTML = '';
            if (oDivResult) {
                for (var i = 0, len = arr.length; i < len; i++) {
                    oDivResult.innerHTML += '<font size=2 color = #efaa00>' + arr[i] + ' </font></br>';
                }
                oDivResult.style.display = "block";
                oDivResult.style.left = x;
                oDivResult.style.top = y;
            }
        }
        $.post(url, fnCallBack, null);

       }

</script> 
</head>
<body class = "CommonPage_Body">
    <form id="form1" runat="server">


        <table >

            <tr>
                <td >
                <asp:Button ID="Button_Add" runat="server" OnCommand="Button_Add_Command" Text="增加" 
                        skinid="Button" Enabled="False"/>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Panel ID="Panel_Gridlist" runat="server">
                        <table style="width: 100%;">
                            <tr>
                                <td>
                                    <asp:Label ID="Label1" runat="server" Text="操作员名称" SkinID = "Label"></asp:Label>
                                    <asp:TextBox ID="txtUser" runat="server" ></asp:TextBox>
                        <asp:Button ID="Button_Browse" runat="server" Text="查询" skinid="Button" 
                            onclick="Button_Browse_Click"/>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                   <asp:LinkButton ID="LinkButton_First" runat="server" CommandArgument="First" 
                            OnClick="MyClick" ><img src = "../../App_Themes/Default_1/Images/Page_First.gif" class = "Page_First"alt = "首页" /></asp:LinkButton>                
                        <asp:LinkButton ID="LinkButton_Prev" runat="server" CommandArgument="Prev" 
                            OnClick="MyClick"><img  src = "../../App_Themes/Default_1/Images/Page_Prev.gif" class = "Page_Prev"  alt = "上页"/></asp:LinkButton>               
                        <asp:LinkButton ID="LinkButton_Next" runat="server" CommandArgument="Next" 
                            OnClick="MyClick"><img  src = "../../App_Themes/Default_1/Images/Page_Next.gif"  class = "Page_Next"  alt = "下页"/></asp:LinkButton>                      
                        <asp:LinkButton ID="LinkButton_Last" runat="server" CommandArgument="Last" 
                            OnClick="MyClick"><img   src = "../../App_Themes/Default_1/Images/Page_Last.gif" class = "Page_Last" alt = "末页"/></asp:LinkButton>
                        <asp:Label ID="Label_Total" runat="server" SkinID="Label" Text="共："></asp:Label>
                        <asp:Label ID="Label_CurrenPageAndTo" runat="server" SkinID="Label" 
                            Text="页，当前第 页，转到"></asp:Label>
                        <asp:TextBox ID="TextBox_PageIndex" runat="server" Width="26px"></asp:TextBox>
                        <asp:Label ID="Label4" runat="server" SkinID="Label" Text="页"></asp:Label>
                        <asp:RangeValidator ID="RangeValidator_PageIndex" runat="server" 
                            ControlToValidate="TextBox_PageIndex" ErrorMessage="*" MaximumValue="10000" 
                            MinimumValue="1" Type="Integer"></asp:RangeValidator>
                        <asp:Button ID="Button_PageGo" runat="server" CommandArgument="GotoPage" 
                            OnClick="MyClick" skinid="Button" Text="GO" />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                  <asp:GridView ID="GridView_Users" runat="server" AutoGenerateColumns="False" 
                            SkinID="gridview">
                            <Columns>
                                <asp:TemplateField HeaderText="操作员ID">
                                    <ItemTemplate>
                                        <asp:Label ID="LinkButton1" runat="server" onmouseout="fade();" 
                                            onmouseover="ShowDetail(this);" Text='<%# Eval("UserID") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="UserName" HeaderText="操作员名称" ReadOnly="True" 
                                    SortExpression="操作员名称" />
                                <asp:BoundField DataField="CreateTime" HeaderText="创建时间" ReadOnly="True" 
                                    SortExpression="创建时间" />
                                <asp:CheckBoxField DataField="IsStop" HeaderText="停用" ReadOnly="True" 
                                    SortExpression="停用" />
                                <asp:TemplateField>
                                    <ItemTemplate>
                                        <asp:Button ID="Button_Edit" runat="server" 
                                            CommandArgument='<%# Eval("UserID") %>' oncommand="Button_Edit_Command" 
                                            skinid="Button" Text="编辑" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                        </asp:GridView>
                                </td>
                            </tr>
                        </table>   
                    </asp:Panel>
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;
                    <asp:Panel ID="Panel_Edit" runat="server" visible="false">
                        <table style="width:100%;">
                            <tr>
                                <td>
                                    <asp:Label ID="Label5" runat="server" Text="操作员ID：" SkinID="Label"></asp:Label>
                                </td>
                                <td>
                                    <asp:TextBox ID="TextBox_UserId" runat="server" SkinID="TextBox" ></asp:TextBox>
                                </td>
                                <td>
                                    &nbsp;</td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="Label6" runat="server" Text="操作员姓名：" SkinID="Label"></asp:Label>
                                </td>
                                <td >
                                    <asp:TextBox ID="TextBox_UserName" runat="server" SkinID="TextBox"></asp:TextBox>
                                </td>
                                <td>
                                    &nbsp;</td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="Label10" runat="server" Text="停用：" SkinID="Label"></asp:Label>
                                </td>
                                <td >
                                    <asp:CheckBox ID="CheckBox_StopFlag" runat="server" SkinID="CheckBox" />
                                </td>
                                <td>
                                    &nbsp;</td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Button ID="Button_Save" runat="server"   skinid ="Button" 
                                        Text="保存"  UseSubmitBehavior="False" oncommand="Button_Save_Command" OnClientClick="tb_remove();"/>
                                    <asp:Button ID="Button_Cancel"  skinid ="Button" runat="server"
                                        Text="取消" oncommand="Button_Cancel_Command"  OnClientClick="closewind();"/>
                                </td>
                                <td >
                                    &nbsp;</td>
                                <td>
                                    &nbsp;</td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                        </table>
                    </asp:Panel>
                </td>
            </tr>
            <tr>
                <td >
                    <asp:HiddenField ID="EditFlag" runat="server" Value="0" />
                    <asp:HiddenField ID="CurrentPage" runat="server" Value="0" />
                    &nbsp;
                    &nbsp;
                </td>
            </tr>
        </table>
          <div id = "MyThickBox"></div>
          <div id="divResult"  style="border:1px dotted black ;width:100px;position:absolute;display:none;background-color:#fffaf3"></div>
    </form>
</body>
</html>
<% =alert %>